import request from '@/utils/request'
function getToken() {
  const token = localStorage.getItem('business-token')
  return token
}
//运营模板消息分页
export async function queryOpeOrderByCondition(params) {
  return request(`/hzsx/messageTem/getMessageTemplateByPage`, {
    method: 'POST',
    data: params,
    headers: { token: getToken() }
  })
}
export async function saveMessageTemplate(params) {
  return request(`/hzsx/messageTem/saveMessageTemplate`, {
    method: 'POST',
    data: params,
    headers: { token: getToken() }
  })
}

export async function updateMessageTemplate(params) {
  return request(`/hzsx/messageTem/updateMessageTemplate`, {
    method: 'POST',
    data: params,
    headers: { token: getToken() }
  })
}

export async function delMessageTemplate(params) {
  return request(`/hzsx/messageTem/delMessageTemplate?id=${params.id}`, {
    method: 'get',
    data: params,
    headers: { token: getToken() }
  })
}

// 获取审核人列表
export const getBackstageUserByShopId = params => {
  return request(`/hzsx/user/queryBackstageUserByShopId`, {
    method: 'GET',
    params,
    headers: { token: getToken() }
  })
}
// 派单操作
export const changeOrderAuditor = data => {
  return request(`/hzsx/ope/order/changeOrderAuditor`, {
    method: 'POST',
    data,
    headers: { token: getToken() }
  })
}

// 加入黑名单操作
export const addToBlack = data => {
  return request('/hzsx/blackList/blackListAdd', {
    method: 'POST',
    data,
    headers: { token: getToken() }
  })
}
//申请公证
export const handleOrderNotary = data => {
  return request('/hzsx/business/order/orderNotary', {
    method: 'POST',
    data,
    headers: { token: getToken() }
  })
}
//取消公证
export const handelCancelOrderNotary = data => {
  return request('/hzsx/business/order/cancelOrderNotary', {
    method: 'POST',
    data,
    headers: { token: getToken() }
  })
}
// 重新获取公证地址
export const handelQueryOrderNotaryLink = data => {
  return request('/hzsx/business/order/queryOrderNotaryLink', {
    method: 'POST',
    data,
    headers: { token: getToken() }
  })
}

// 重新获取公证结果
export const handelQueryOrderNotary = data => {
  return request('/hzsx/business/order/queryOrderNotary', {
    method: 'POST',
    data,
    headers: { token: getToken() }
  })
}
